package com.qn.visitor.analyze.ipaddressr.strategy.ipwhois;

import com.fasterxml.jackson.annotation.JsonProperty;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.io.Serializable;
/**
 * qingniu-cloud user source analysis
 *
 * @Author: TXG
 * @Date: 2024/6/11
 * @Version V0.0.2
 */
@NoArgsConstructor
@Data
public class IpwhoisModel implements Serializable {

    @JsonProperty("ip")
    private String ip;
    @JsonProperty("success")
    private Boolean success;
    @JsonProperty("type")
    private String type;
    @JsonProperty("continent")
    private String continent;
    @JsonProperty("continent_code")
    private String continentCode;
    @JsonProperty("country")
    private String country;
    @JsonProperty("country_code")
    private String countryCode;
    @JsonProperty("region")
    private String region;
    @JsonProperty("region_code")
    private String regionCode;
    @JsonProperty("city")
    private String city;
    @JsonProperty("latitude")
    private Double latitude;
    @JsonProperty("longitude")
    private Double longitude;
    @JsonProperty("is_eu")
    private Boolean eu;
    @JsonProperty("postal")
    private String postal;
    @JsonProperty("calling_code")
    private String callingCode;
    @JsonProperty("capital")
    private String capital;
    @JsonProperty("borders")
    private String borders;
    @JsonProperty("flag")
    private FlagDTO flag;
    @JsonProperty("connection")
    private ConnectionDTO connection;
    @JsonProperty("timezone")
    private TimezoneDTO timezone;
    @JsonProperty("currency")
    private CurrencyDTO currency;
    @JsonProperty("security")
    private SecurityDTO security;

    @NoArgsConstructor
    @Data
    public static class FlagDTO {
        @JsonProperty("img")
        private String img;
        @JsonProperty("emoji")
        private String emoji;
        @JsonProperty("emoji_unicode")
        private String emojiUnicode;
    }

    @NoArgsConstructor
    @Data
    public static class ConnectionDTO {
        @JsonProperty("asn")
        private Integer asn;
        @JsonProperty("org")
        private String org;
        @JsonProperty("isp")
        private String isp;
        @JsonProperty("domain")
        private String domain;
    }

    @NoArgsConstructor
    @Data
    public static class TimezoneDTO {
        @JsonProperty("id")
        private String id;
        @JsonProperty("abbr")
        private String abbr;
        @JsonProperty("is_dst")
        private Boolean isDst;
        @JsonProperty("offset")
        private Integer offset;
        @JsonProperty("utc")
        private String utc;
        @JsonProperty("current_time")
        private String currentTime;
    }

    @NoArgsConstructor
    @Data
    public static class CurrencyDTO {
        @JsonProperty("name")
        private String name;
        @JsonProperty("code")
        private String code;
        @JsonProperty("symbol")
        private String symbol;
        @JsonProperty("plural")
        private String plural;
        @JsonProperty("exchange_rate")
        private Integer exchangeRate;
    }

    @NoArgsConstructor
    @Data
    public static class SecurityDTO {
        @JsonProperty("anonymous")
        private Boolean anonymous;
        @JsonProperty("proxy")
        private Boolean proxy;
        @JsonProperty("vpn")
        private Boolean vpn;
        @JsonProperty("tor")
        private Boolean tor;
        @JsonProperty("hosting")
        private Boolean hosting;
    }
}
